package com.jackaltsc.mydemolist.activity;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

/**
 * 直接显示一个列表的Activity 不需要布局文件
 * <p>
 * Created by JackalTsc on 2016/7/13.
 */
public class ListTActivity extends ListActivity {

    //适配器
    ArrayAdapter<String> arrayAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1);

        for (int i = 0; i < 10; i++) {
            arrayAdapter.add("这是数据项" + i);
        }

        setListAdapter(arrayAdapter);

    }
}
